package com.woniu.service.sportsHealth.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.woniu.mapper.sportsHealth.BloodPressureMapper;
import com.woniu.model.sportsHealth.entity.BloodPressure;
import com.woniu.model.sportsHealth.model.dto.BloodPressureDto;
import com.woniu.model.sportsHealth.model.vo.BloodPressureVo;
import com.woniu.service.sportsHealth.IBloodPressureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 血压表 服务实现类
 * </p>
 *
 * @author Jet
 * @since 2023-10-23
 */
@Service
public class BloodPressureServiceImpl extends ServiceImpl<BloodPressureMapper, BloodPressure> implements IBloodPressureService {

    @Autowired
    BloodPressureMapper bloodPressureMapper;
    @Override
    public PageInfo<BloodPressureDto> findAll(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<BloodPressureDto> bloodPressureDtoList = bloodPressureMapper.findAll(param);
        PageInfo<BloodPressureDto> pageInfo = new PageInfo<>(bloodPressureDtoList);
        return pageInfo;
    }

    @Override
    public List<BloodPressureVo> findAllExport() {
        List<BloodPressureVo> allExport = bloodPressureMapper.findAllExport();
        return allExport;
    }
}
